#!/usr/bin/env python3

from sklearn import tree

clf = tree.DecisionTreeClassifier()

# 学习定义：价格，排量，销量
X = [[70,3.0,1020],[12,1.5,3800],[35,2.0,1200],[18,1.8,7000],[90,3.0,300],[10,1.0,8000],[22,2.0,6000]]
Y = ['豪华','非豪华','豪华','非豪华','豪华','非豪华','非豪华']

#让clf进行XY的对应学习
clf = clf.fit(X,Y)

#输入预测值
prediction = clf.predict([[25,1.5,10000],[45,2.4,500]])

print(prediction)